<template>
  <div style="margin: 30px">
    <div class="box-text-1">
      <diV class="box-text-2">物品名称:</diV><div><input v-model="material.Itemname" style="width: 300px" type="text"></div>
    </div>
    <div  class="box-text-1">
      <div  class="box-text-2">规格:</div><div><input v-model="material.Specifications" type="text"></div>
    </div>
    <div class="box-text-1">
      <div  class="box-text-2">生产厂家:</div><div><input v-model="material.Manufacturer" style="width: 200px" type="text"></div>
    </div>
    <div class="box-text-1">
      <div class="box-text-2">单价:</div><div><input v-model="material.Price" type="text"></div>
    </div>
    <div style="width: 400px;text-align: center;margin-top: 20px">
      <el-button style="width: 70px;background: linear-gradient(paleturquoise,royalblue)" type="primary" @click="tijiao">提交</el-button>
      <el-button style="width: 70px;background: linear-gradient(paleturquoise,royalblue)" type="primary" @click="empty">重置</el-button>
      <el-button style="width: 70px;background: linear-gradient(paleturquoise,royalblue)" type="primary" @click="$router.push('/supplier')">返回</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: "Addmaterials",
  data(){
    return{
      material:{}
    }
  },
  methods:{
    tijiao(){
      this.$axios.post("/api/material/addmaterials",this.material).then(res=>{
        console.log(res)
        if(res.data.status===1){
          this.$message.success(res.data.msg)
        }else {
          this.$message.error(res.data.msg)
        }
      })
    }
  }
}
</script>

<style scoped>
.box-text-2{
  width: 130px;
  text-align: right;
}
.box-text-1 div{
  display: inline-block;
  margin-top: 20px;
}
input{
  margin-left: 80px;
}
textarea {
  margin-left: 80px;
}
</style>